//加载公共样式
require('../../assets/css/index.less')

//加载自己的样式
require('./run.less')
//引入字体图标
require('../../assets/fonts/iconfont.css')

//引入tabbar渲染函数
const renderTabbar = require('../../utils/tabbar')
//导入navbar
const renderNavbar = require('../../utils/navbar')




window.onload = () => {

  //渲染tabbar
  renderTabbar('run')
  renderNavbar('run')

 /* 获取元素 */
let go = document.querySelector('#go')
let mask= document.querySelector('#time-mask')
let route= document.querySelector('.route')
/* 点击进入倒计时蒙层 */
go.addEventListener('click',function(){
  mask.style.display='block'
  route.style.display='none'
  
  let time = 3
    let timer = setInterval(() => {
      //时间为1 跳转到首页
      if (time === 1) {
        clearInterval(timer)
        window.location.href = './map.html'
        mask.innerHTML = `GO`
        return
      }
      time--
      mask.innerHTML = `${time}`
    }, 1000)

})

}
